package com.mapull.example.section1;

/**
 * StringStartWith
 *
 * @author mapull
 * @date 2021-09-06
 * @since 1.0
 **/
public class StringStartWith {
    public static void main(String[] args) {
        String text = "hello world";
        System.out.println(text.startsWith("he",0));//true
        System.out.println(text.startsWith("wo",6));//true
        System.out.println(text.startsWith("hello",1));//false

        String sentence = "我爱学习";
        System.out.println(sentence.startsWith("我",1));//false
        System.out.println(sentence.startsWith("学习",2));//true
    }
    public static void main1(String[] args) {
        String text = "hello world";
        System.out.println(text.startsWith("he"));//true
        System.out.println(text.startsWith("wo"));//false
        System.out.println(text.startsWith("hello"));//true

        String sentence = "我爱学习";
        System.out.println(sentence.startsWith("我"));//true
        System.out.println(sentence.startsWith("学习"));//false
    }
}
